package com.ctgu.com;

public class NextData {
	public NextData(){}

	public static String classify(int month, int day, int year){
		
		if( month<1 || month>12 || day>31 || day<1 || year>2050 || year < 1900)
				return "日期输入的数据错误，不符合输入的要求";
		else switch(month){
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
				if(day != 31){
					day = day + 1;
					
				}
				else {
					
				day = 1;
				month = month + 1;
				
				}
				break;
				
			case 12:
				if(day != 31){
					day = day+1;
					
				}
				else{
					month = 1;
					day = 1;
					year = year + 1;
				
				}
				break;
				
			case 4:
			case 6:
			case 9:
			case 11:
				if(day == 30){
					month = month + 1;
					day = 1;
				}
				else if(day==31){
					return "4,6,9,11这些月份没有31, 日期输入错误";
					
				}
				else
					day = day + 1;
				
				break;
				
			case 2:
				if(year%400==0 || (year%4==0&&year %100!=0)){
					if(day==29){
						month = month +1 ;
						day = 1;
					}
					else if(day>29){
						return "闰年2月份的日期输入错误";
						
					}
					else 
						day = day + 1;
				}
				else{ 
					if(day == 28){
						month = month + 1;
						day = 1;
					}
					else if(day >=28){
						return "2月份的日期输入错误";
						}
					else
						day = day + 1 ;
					
					break;
				}
				
		}
		String y = Integer.toString(year);
		String m = Integer.toString(month);
		String d = Integer.toString(day);
		
		return y+'年'+m+'月'+d+'日';

			
	}
}